/**
 * 
 * @Project le cOeur - Data Virtualization
 * @Date 08.12.2012
 * @Author Aebi Pascal, Kocher Marc
 * @School BFH-TI Biel, Bachelor Thesis
 *
 */

package main.framework.http;

/**
 * This class holds all supported HTTP versions of the web service.
 */
public enum Version {
	
	HTTP_1_1("HTTP/1.1");
	
	private String value;
	
	private Version(String value){
		this.value = value;
	}
	
	/**
	 * Returns the value of the object.
	 * 
	 * @return The version string value.
	 */
	public String getValue(){
		return this.value;
	}
	
	/**
	 * Returns the corresponding version of to the given string value.
	 * 
	 * @param value The version string value.
	 * @return The corresponding version enumeration object.
	 */
	public static Version getFromValue(String value) {
	    if(value != null){
			for (Version version : Version.values()) {
				if (value.equalsIgnoreCase(version.value)) {
					return version;
				}
			}
	    }
	    return null;
	}
	
}
